<%@ page import="java.io.*"%>
<%@ page import="javax.xml.transform.*"%>
<%@ page import="javax.xml.transform.stream.*"%>

    <%
        //FORMATAGE DU XML
        TransformerFactory tFactory = TransformerFactory.newInstance();
        Transformer transformer = tFactory.newTransformer(new StreamSource(String.valueOf(request.getAttribute("xslPath"))));
        StringWriter res = new StringWriter();
        transformer.transform(
                new StreamSource(new StringReader(String.valueOf(request.getAttribute("dataToPrint")))),
                new StreamResult(res));

        out.println(res);
    %>